#include<stdio.h>
int main()
{
	int x,a,b,c,d;
	scanf("%d",&x);
	a=x%2==0&&x>4&&x<=12?1:0;
	b=x%2==0||(x>4&&x<=12)?1:0;
	c=x%2==0^x>4&&x<=12?1:0;
	d=x%2!=0&&(x<=4||x>12)?1:0;
	printf("%d %d %d %d",a,b,c,d);
    return 0;
}

